/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.mrroman.linksender.gui;

import java.awt.Font;

import javax.swing.Icon;
import javax.swing.ImageIcon;

import com.mrroman.linksender.Configuration;
import com.mrroman.linksender.ioc.In;
import com.mrroman.linksender.ioc.Init;
import com.mrroman.linksender.ioc.Name;

/**
 *
 * @author mrozekon
 */
@Name("gui.fontstore")
public class ResourceStore {

    @In
    private Configuration config;

    private Font authorLabelFont,
            dateLabelFont,
            messageLabelFont;

    private Icon openIcon,
            removeIcon,
            copyIcon,
            replyIcon;
    
    @Init
    public void init() {
        authorLabelFont = new Font(
            config.getAuthorLabelFontName(),
                config.getAuthorLabelFontStyle().get(),
                config.getAuthorLabelFontSize());

        dateLabelFont = new Font(
            config.getDateLabelFontName(),
                config.getDateLabelFontStyle().get(),
                config.getDateLabelFontSize());

        messageLabelFont = new Font(
            config.getMessageLabelFontName(),
                config.getMessageLabelFontStyle().get(),
                config.getMessageLabelFontSize());

        copyIcon = new ImageIcon(
                getClass().getResource("resources/edit-copy.png"));

        openIcon = new ImageIcon(
                getClass().getResource("resources/document-open.png"));

        removeIcon = new ImageIcon(
                getClass().getResource("resources/edit-delete.png"));

        replyIcon = new ImageIcon(
                getClass().getResource("resources/mail-reply-sender.png"));
    }

    public Font getAuthorLabelFont() {
        return authorLabelFont;
    }

    public Font getDateLabelFont() {
        return dateLabelFont;
    }

    public Font getMessageLabelFont() {
        return messageLabelFont;
    }

    public Icon getCopyIcon() {
        return copyIcon;
    }

    public Icon getOpenIcon() {
        return openIcon;
    }

    public Icon getRemoveIcon() {
        return removeIcon;
    }

    public Icon getReplyIcon() {
        return replyIcon;
    }

}
